<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/11/27
 * Time: 0:50
 */
require("Include/conn.php");
if(!empty($_COOKIE['user_id'])){
    $user_id = $_COOKIE['user_id'];
    $user_name=$_GET["name"];
    $user_pwd=$_GET["pwd"];
    $user_confirm=$_GET["confirm"];
    $user_email=$_GET["email"];
    $user_sign=$_GET["sign"];

    if($user_pwd==$user_confirm){
        $sql = "UPDATE `pw_user` SET `user_name`='$user_name',`user_pwd`='$user_pwd',`user_email`='$user_email',`user_sign`='$user_sign' WHERE `user_id`=$user_id;";
        $result = mysqli_query($link,$sql);
        if($result){
            echo '<script>alert("修改成功！");history.go(-2);</script>';
        }
        else{
            echo '<script>alert("修改失败！");history.go(-1);</script>';
        }
    }
    else{
        echo '<script>alert("两次密码不一致，请重新输入");history.go(-1);</script>';
    }
}

else{
    echo '<script>alert("请登录！");history.go(-1);</script>';
}


//UPDATE `pw_user` SET `user_name`='jiahuanting5',`user_pwd`='123456',`user_email`='jiahuanting@126.com',`user_sign`='i love my school.' WHERE `user_id`=2;

?>